﻿@using Webdiyer.WebControls.Mvc
@using XXF.Extensions;
@model PagedList<Dyd.BaseService.ConfigManager.Domain.Model.tb_config_model>

<table class="mytable" style="table-layout: fixed;" width="100%">
    <tr>
        <th style="width: 3%;">Id</th>
        <th style="width: 10%;">分类</th>
        <th style="width: 22%;">配置键</th>
        <th style="width: 25%">配置信息</th>
        <th style="width: 20%">备注</th>
        <th style="width: 10%;">更新时间</th>
        <th style="width: 10%;">操作</th>
    </tr>
    @foreach (var item in Model)
    {
        <tr data-id="@item.id">
            <td>@item.id</td>
            <td>@item.categoryname</td>
            <td><span title="@item.configkey">@item.configkey.SubString3(50)</span></td>
            <td style="text-align: left">
                <span title="@item.configvalue">配置值:@item.configvalue.SubString3(30)</span>
                @if (item.loadbalancealgorithmenum >= 0)
                { 
                    <br />
                    <span>负载均衡: <span style="color: green">启用</span></span>
                }
                @if (item.failoversequence >= 0)
                { 
                    <br /><span>故障转移: <span style="color: green">启用</span> @Html.Raw(item.failoversequence>0?"<span style='color:red'>故障中</span>":"")</span>
                }
            </td>
            <td style="text-align:left" title="@item.remark">@item.remark.SubString3(20)</td>
            <td  style="text-align:left">@item.lastupdatetime</td>
            <td><a href="#" class="edit">修改</a> <a href="#" class="del">删除</a> <a href="@Url.Action("ProjectIndex", "Project", new {categoryid=item.categoryid })" target="_blank">相关项目</a></td>
        </tr>
    }
</table>
<div class="total pt10">
    <div class="fl">共<em>@Model.TotalPageCount</em>页<em>@Model.TotalItemCount</em>条记录，当前为第<em>@Model.CurrentPageIndex</em>页</div>
    @Html.Pager(Model, new PagerOptions { PageIndexParameterName = "pageIndex", ShowPageIndexBox = true, PageIndexBoxType = PageIndexBoxType.TextBox, CssClass = "mvcPager" })
</div>
